<template>
  <div>
    <h1>依赖注入</h1>
    <button @click="age++">{{ age }}</button>
    <hr />

    <HelloWorld />
  </div>
</template>

<script>
import { provide, ref } from 'vue'
import HelloWorld from './components/HelloWorld.vue'

export default {
  components: {
    HelloWorld
  },

  setup() {
    provide('aaa', '张三')
    provide('bbb', '里斯')

    const age = ref(10)
    provide('age', age)

    return {
      age
    }
  }
}
</script>
